package com.test.spring4;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

//一般没有明确角色时使用
@Component("myUser")//默认类名，也可以指定名字
public class User {

	@Autowired
	@Qualifier("myUserDao")//根据名字获取
	private UserDao userDao;

	public void show(){
		System.out.println("=======show=========");
		System.out.println(userDao);
	}
	
}
